setBackground

open fun setBackground(@NonNull view: View, @Nullable background: Drawable)(source)

Deprecated

Call setBackground directly.

Set the background of the view to a given Drawable, or remove the background. If the background has padding, view's padding is set to the background's padding. However, when a background is removed, this View's padding isn't touched. If setting the padding is desired, please use setPadding(int, int, int, int).

Parameters

view

view for which to set the background.

background

the drawable to use as view background.